feat: Add resouce types#938
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
@seamapi/types-based parameter and response shapes with types derived from the@seamapi/blueprintso documented endpoints expose accurate parameter optionality, nullability, lists, nested objects and enums.@seamapi/typesroute types for undocumented endpoints and action-attempt responses where the blueprint cannot be used without breaking existing helpers.Description
codegen/lib/layouts/route.tsandcodegen/lib/connect.tsand updating templates to conditionally use blueprint-derived types; undocumented endpoints and action-attempt responses keep@seamapi/types-based signatures.src/lib/seam/connect/routes/blueprint-resources.tsthat contains exported resource types (e.g.,DeviceResource,AccessCodeResource,ActionAttemptResource, etc.) and updated route files to import and reference these types where appropriate.RouteRequest/RouteResponseusage for legacy/undocumented cases or inline/declared blueprint-derived types for documented endpoints; added helpers (getResourceTypeName,renderBlueprintResources, object/enum renderers) to render TypeScript types from blueprint metadata.src/lib/seam/connect/routes/...so many route signatures now reference blueprint-derived parameter and response types while retaining legacy types where needed.Testing
npm run generateand formatting/ESLint fixes as part of the pipeline, which completed successfully.npm run typecheck(TypeScripttsc) andnpm run lint, both of which passed after the generator updates and template fixes.npx c8 ava --timeout=2m, which completed successfully; note that the defaultnpm testrun exceeded AVA’s default timeout, but the same suite passed with the explicit two-minute timeout.prettier --check) and generation output consistency during thepostgeneratestep (no formatting errors reported).Codex Task